package zisu.netty.practice.netty.secs;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
import zisu.netty.practice.netty.secs.entity.HSMSMessage;

import java.util.Arrays;

/**
 * @Desc: ""
 * @Author: caixiang
 * @DATE: 2020/7/29 11:36
 */
public class MyMessageToByteEncoder extends MessageToByteEncoder<ByteBuf> {
    //编码方法
    @Override
    protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception {
        System.out.println("come into encode:");
        out.writeBytes(msg);

    }
}
